$(document).ready(function() {

	//alert(window.location.pathname);
	//var exists = urlExists(url);
	var page = getURLParameter('page');
	if(page == 'null'){
		fetchContent("registration.php");
	} else {
		fetchContent(page);
	}

});

function fetchContent(fileName){
	$.ajax({
	  type: "POST",
	  url: fileName
	}).done(function( msg ) {
		$('#mainContainer').empty();
		$('#mainContainer').append(msg);
		$( "#tabs" ).tabs();
		
	  	validateLoginForm();
	});
	

}


function getURLParameter(name) {
    return decodeURI(
        (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
    );
}

